﻿using Kaskelot.SP.Model.Contracts;
using Kaskelot.SP.Services;
using Stockholm.SOA.Kaskelot.WCF.DataContracts;
using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Kaskelot.SP.Model.Client;

namespace Kaskelot.SP.UI.CONTROLTEMPLATES.Kaskelot.SP.UI.Forms
{
	public partial class ByggnadHandelseLoggForm : BaseForm, IForm
	{
		public string Id { get; set; }
		public string ParentId { get; set; }
		public ByggnadHandelseLogg Current { get; set; }

		protected void Page_Load(object sender, EventArgs e)
		{
			try
			{
				ByggnadService svc = new ByggnadService();

				if (this.Id != null)
				{
					Guid bhlId = new Guid(this.Id);
					this.Current = svc.GetByggnadHandelseLogg(bhlId);
				}
				else
				{
					this.Current = new ByggnadHandelseLogg();
					this.Current.Datum = DateTime.Now;
				}
			}
			catch (Exception ex)
			{

			}
		}
	}
}
